package com.ctshk.rpc.goods.mapper;

import com.ctshk.rpc.goods.base.CustomBaseMapper;
import com.ctshk.rpc.goods.entity.CommodityHotWord;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * TODO
 *
 * @author 黄利斌
 * @date 2021/5/25 3:50 下午
 */
public interface CommodityHotWordMapper extends CustomBaseMapper<CommodityHotWord> {
    /**
     * 查询七天内的搜索关键词数展示十个
     * @return
     */
    @Select("SELECT words FROM t_commodity_hot_word WHERE DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= DATE(gmt_create) ORDER BY number DESC LIMIT 10")
    List<String> findSevenDaySearchWords();

}
